--This Test Should have 2 children for both pass and fail task
-- ONWATCH STATIC DATA --
INSERT INTO AUTOSC.CFG_TASK_CATEGORY_INFO (TASK_CATEGORY_ID, TASK_CATEGORY, QUEUE_NAME) 
	VALUES (5, 'ONWATCH', 'autosc.jms.onwatch.queue');

INSERT INTO AUTOSC.CFG_TASK_TYPE ( TASK_TYPE_ID, TASK_TYPE_NAME, TASK_CATEGORY_ID, MAX_RETRY_COUNT, CODE_GROUP, EXT_AUTOSC, PRIORITY, RUNTIME_LENGTH) 
	VALUES ( 33, 'ONWATCH_TEST_TASK_TYPE', 5, 0, 'A', 'T', 5, 1440 );
INSERT INTO AUTOSC.CFG_TASK_TYPE ( TASK_TYPE_ID, TASK_TYPE_NAME, TASK_CATEGORY_ID, MAX_RETRY_COUNT, CODE_GROUP, EXT_AUTOSC, PRIORITY, RUNTIME_LENGTH) 
	VALUES ( 34, 'POST_ONWATCH_S_TASK_TYPE', 5, 0, 'S', 'T', 5, 1440);
INSERT INTO AUTOSC.CFG_TASK_TYPE ( TASK_TYPE_ID, TASK_TYPE_NAME, TASK_CATEGORY_ID, MAX_RETRY_COUNT, CODE_GROUP, EXT_AUTOSC, PRIORITY, RUNTIME_LENGTH) 
	VALUES ( 35, 'POST_ONWATCH_F_TASK_TYPE', 5, 0, 'F', 'T', 5, 1440);	

INSERT INTO AUTOSC.CFG_TASK_CLASS_MAP (TASK_CLASS_MAP_ID, TASK_TYPE_NAME, TASK_CLASS)
	VALUES ( CFG_TASK_CLASS_MAP_ID_SEQ.nextVal,  'POST_ONWATCH_S_TASK_TYPE', 'dummyTask');
INSERT INTO AUTOSC.CFG_TASK_CLASS_MAP (TASK_CLASS_MAP_ID, TASK_TYPE_NAME, TASK_CLASS)
	VALUES ( CFG_TASK_CLASS_MAP_ID_SEQ.nextVal,  'POST_ONWATCH_F_TASK_TYPE'', 'dummyTask');


INSERT INTO AUTOSC.CFG_REQUEST_DEFN (REQUEST_DEFN_ID, REQUEST_TYPE_ID, MODALITY, MODEL_TYPE, REQUEST_DESC, INITIAL_TASK_ID, VERIFIER, REQUESTER, EXPIRES_ON) 
	VALUES(8, 2103, 'GSP', '_XPTEST', 'ONWATCH_TEST_REQUEST', 33, 'faichun.siu@ge.com', 'faichun.siu@ge.com', sysdate + 12000);
INSERT INTO AUTOSC.CFG_REQUEST_DEFN (REQUEST_DEFN_ID, REQUEST_TYPE_ID, MODALITY, MODEL_TYPE, REQUEST_DESC, INITIAL_TASK_ID, VERIFIER, REQUESTER, EXPIRES_ON) 
	VALUES(9, 2094, 'GSP', '_XPTEST', 'ONWATCH_TEST_REQUEST', 33, 'faichun.siu@ge.com', 'faichun.siu@ge.com', sysdate + 12000);
INSERT INTO AUTOSC.CFG_REQUEST_DEFN (REQUEST_DEFN_ID, REQUEST_TYPE_ID, MODALITY, MODEL_TYPE, REQUEST_DESC, INITIAL_TASK_ID, VERIFIER, REQUESTER, EXPIRES_ON) 
	VALUES(10, 2100, 'GSP', '_XPTEST', 'ONWATCH_TEST_REQUEST', 1384, 'faichun.siu@ge.com', 'faichun.siu@ge.com', sysdate + 12000);	

INSERT INTO AUTOSC.CFG_SWEEP_PROPERTIES (SWEEP_PROP_ID, PROP_NAME, PROP_VALUE)
	VALUES(5, 'ONWATCH_CMD_DIR', 'test/');
INSERT INTO AUTOSC.CFG_SWEEP_PROPERTIES (SWEEP_PROP_ID, PROP_NAME, PROP_VALUE)
	VALUES(6, 'ONWATCH_CMD_FILE', 'test_cmd_file.xml');
INSERT INTO AUTOSC.CFG_SWEEP_PROPERTIES (SWEEP_PROP_ID, PROP_NAME, PROP_VALUE)
	VALUES(7, 'ONWATCH_USER', 'root');
INSERT INTO AUTOSC.CFG_SWEEP_PROPERTIES (SWEEP_PROP_ID, PROP_NAME, PROP_VALUE)
	VALUES(8, 'IS_DYNAMIC', 'true')
INSERT INTO AUTOSC.CFG_SWEEP_PROPERTIES (SWEEP_PROP_ID, PROP_NAME, PROP_VALUE)
	VALUES(9, 'IS_DEBUG', 'true');

INSERT INTO CFG_REQUEST_DEFN_TO_SWEEP_PROP (REQUEST_DEFN_ID, SWEEP_PROP_ID)
	VALUES (9, 5);
INSERT INTO CFG_REQUEST_DEFN_TO_SWEEP_PROP (REQUEST_DEFN_ID, SWEEP_PROP_ID)
	VALUES (9, 6);
INSERT INTO CFG_REQUEST_DEFN_TO_SWEEP_PROP (REQUEST_DEFN_ID, SWEEP_PROP_ID)
	VALUES (9, 7);
INSERT INTO CFG_REQUEST_DEFN_TO_SWEEP_PROP (REQUEST_DEFN_ID, SWEEP_PROP_ID)
	VALUES (9, 8);
INSERT INTO CFG_REQUEST_DEFN_TO_SWEEP_PROP (REQUEST_DEFN_ID, SWEEP_PROP_ID)
	VALUES (9, 9);	

INSERT INTO CFG_ONWATCH_FILE_INFO (ONWATCH_FILE_ID, FILE_ID, FILE_DIRECTORY, FILE_NAME, DIRECTION, FILE_TYPE)
	VALUES (1, 'File1', '/ascddata3/iipTest', 'supportFile1', 'PUT', 'BINARY');
INSERT INTO CFG_ONWATCH_FILE_INFO (ONWATCH_FILE_ID, FILE_ID, FILE_DIRECTORY, FILE_NAME, DIRECTION, FILE_TYPE)
	VALUES (2, 'File2', '/ascddata3/iipTest', 'supportFile2', 'PUT', 'BINARY');
INSERT INTO CFG_ONWATCH_FILE_INFO (ONWATCH_FILE_ID, FILE_ID, FILE_DIRECTORY, FILE_NAME, DIRECTION, FILE_TYPE)
	VALUES (3, 'File1', '/ascddata3/iipTest', 'supportFile3', 'GET', 'BINARY');
INSERT INTO CFG_ONWATCH_FILE_INFO (ONWATCH_FILE_ID, FILE_ID, FILE_DIRECTORY, FILE_NAME, DIRECTION, FILE_TYPE)
	VALUES (4, 'File2', '/ascddata3/iipTest', 'supportFile4', 'GET', 'ASCII');			    

INSERT INTO CFG_REQ_DEFN_TO_ONWATCH_FI (REQUEST_DEFN_ID, ONWATCH_FILE_ID)
	VALUES (9, 1);
INSERT INTO CFG_REQ_DEFN_TO_ONWATCH_FI (REQUEST_DEFN_ID, ONWATCH_FILE_ID)
	VALUES (9, 2);	
INSERT INTO CFG_REQ_DEFN_TO_ONWATCH_FI (REQUEST_DEFN_ID, ONWATCH_FILE_ID)
	VALUES (9, 3);
INSERT INTO CFG_REQ_DEFN_TO_ONWATCH_FI (REQUEST_DEFN_ID, ONWATCH_FILE_ID)
	VALUES (9, 4);

INSERT INTO AUTOSC.CFG_TASK_RELATIONSHIP ( RELATION_ID, PARENT_ID, CHILD_ID) 
	VALUES ( AUTOSC.CFG_TASK_RELATIONSHIP_SEQ.nextVal,33 , 34);
INSERT INTO AUTOSC.CFG_TASK_RELATIONSHIP ( RELATION_ID, PARENT_ID, CHILD_ID) 
	VALUES ( AUTOSC.CFG_TASK_RELATIONSHIP_SEQ.nextVal,33 , 35);
INSERT INTO 	AUTOSC.CFG_TASK_RELATIONSHIP ( RELATION_ID, PARENT_ID, CHILD_ID)
    VALUES (AUTOSC.CFG_TASK_RELATIONSHIP_SEQ.nextVal, 1384, 3896);
    
INSERT INTO AUTOSC.CFG_TASK_CLASS_MAP (TASK_CLASS_MAP_ID, TASK_TYPE_NAME, TASK_CLASS)
	VALUES (AUTOSC.CFG_TASK_CLASS_MAP_ ID_SEQ.nextVal,  'GATHER', 'dummyTask');
-- END ONWATCH STATIC DATA --

-- START ONWATCH DYNAMIC DATA --
insert into act_request_list (request_list_id, request_type_id, enter_date, scheduled_date)
	values (100,  2094, sysdate, sysdate);
insert into act_request_list_user (request_user_id, request_list_id, sso, sent_from, reply_to)
	values (101, 100, '212042946', 'faichun.siu@ge.com', 'faichun.siu@ge.com');
insert into act_request (request_id, request_list_id, system_id, code_id, product_line, model_type, modality, ip_address, request_defn_id, start_time, usn)
	values (102, 100, 'ANTTSTIIP1', 3618, 'na', '_XPTEST', 'GSP', '10.99.97.214', 9, sysdate, 'ANTTSTIIP1'); 		
insert into act_task (task_id, request_id, failed_count, step_type_id, task_type, code_id, ext_autosc, priority, expire_date)
	values (103, 102, 0, 817, 'ONWATCH_TEST_TASK_TYPE', 3618, 'T', 5, sysdate + 1000);
insert into act_onwatch_task (onwatch_task_id, onwatch_task_list_id, task_id, entered_date, execution_time_in_sec, task_order, status)
	values (104, 0, 103, sysdate, 0, 0, 'NEW');
insert into act_request_properties(request_property_id, request_id, property_name, property_value)
	values (1, 102, 'JUNIT1', 'JUNIT_PARAM1');
insert into act_request_properties(request_property_id, request_id, property_name, property_value)
	values (2, 102, 'JUNIT2', 'JUNIT_PARAM2');		 	 
-- END ONWATCH DYNAMIC DATA --

-- START ONWATCH DYNAMIC DATA --
insert into act_request_list (request_list_id, request_type_id, enter_date, scheduled_date)
	values (200,  2094, sysdate, sysdate);
insert into act_request_list_user (request_user_id, request_list_id, sso, email_address, address_type)
	values (201, 200, '212042946', 'faichun.siu@ge.com', 'SENT_FROM');
insert into act_request_list_user (request_user_id, request_list_id, sso, email_address, address_type)
	values (202, 200, '212042946', 'faichun.siu@ge.com', 'REPLY_TO');
insert into act_request (request_id, request_list_id, system_id, code_id, product_line, model_type, modality, ip_address, request_defn_id, start_time, usn)
	values (202, 200, 'ANTTSTIIP1', 3618, 'na', '_XPTEST', 'GSP', '10.99.97.214', 9, sysdate, 'ANTTSTIIP1'); 		
insert into act_task (task_id, request_id, failed_count, step_type_id, task_type, code_id, ext_autosc, priority, expire_date)
	values (203, 202, 0, 817, 'ONWATCH_TEST_TASK_TYPE', 3618, 'T', 5, sysdate + 1000);
insert into act_onwatch_task (onwatch_task_id, onwatch_task_list_id, task_id, entered_date, execution_time_in_sec, task_order, status)
	values (204, 0, 203, sysdate, 0, 0, 'NEW');
insert into act_request_properties(request_property_id, request_id, property_name, property_value)
	values (1, 202, 'JUNIT1', 'JUNIT_PARAM1');
insert into act_request_properties(request_property_id, request_id, property_name, property_value)
	values (2, 202, 'JUNIT2', 'JUNIT_PARAM2');		 	 
-- END ONWATCH DYNAMIC DATA --

-- START ONWATCH PRODIAGS SCHEDULE REQUEST
insert into act_request_list (request_list_id, request_type_id, enter_date, scheduled_date)
	values (300,  5028, sysdate, sysdate);
insert into act_request_list_user (request_user_id, request_list_id, sso, email_address, address_type) 
	values (ACT_REQUEST_USER_ID_SEQ.nextVal, 300, '212042946', 'faichun.siu@ge.com', 'SENT_FROM');
insert into act_request_list_user (request_user_id, request_list_id, sso, email_address, address_type) 
	values (ACT_REQUEST_USER_ID_SEQ.nextVal, 300, '212042946', 'faichun.siu@ge.com', 'REPLY_TO');
insert into act_request (request_id, request_list_id, system_id, code_id, product_line, model_type, modality, ip_address, request_defn_id, start_time, usn)
	values (302, 300, 'ANTTSTIIP1', 3618, 'na', '_XPTEST', 'GSP', '10.99.97.214', 2500, sysdate, 'ANTTSTIIP1'); 		
insert into act_request_properties(request_property_id, request_id, property_name, property_value)
	values (ACT_REQUEST_PROPERTIES_SEQ.nextVal, 302, 'TASK_TYPE_1', 'addTask');
insert into act_request_properties(request_property_id, request_id, property_name, property_value)
	values (ACT_REQUEST_PROPERTIES_SEQ.nextVal, 302, 'TASK_NAME_1', 'FLOG');
insert into act_request_properties(request_property_id, request_id, property_name, property_value)
	values (ACT_REQUEST_PROPERTIES_SEQ.nextVal, 302, 'DAY_1', 'SU');
insert into act_request_properties(request_property_id, request_id, property_name, property_value)
	values (ACT_REQUEST_PROPERTIES_SEQ.nextVal, 302, 'TIME_1', '15:45');
insert into act_request_properties(request_property_id, request_id, property_name, property_value)
	values (ACT_REQUEST_PROPERTIES_SEQ.nextVal, 302, 'ITERATION_1', '2');	
-- END ONWATCH PRODIAGS SCHEDULE REQUEST

-- START RESET FROM TASKLIST TEST --
update act_onwatch_task set onawtch_task_list_id = 0, status = 'NEW' where onwatch_task_id = 104;
-- END RESET FROM TASKLIST TEST --



-- START IPTDS DATA --
INSERT INTO AUTOSC.CFG_REQUEST_DEFN (REQUEST_DEFN_ID, REQUEST_TYPE_ID, MODALITY, MODEL_TYPE, REQUEST_DESC, INITIAL_TASK_ID) 
	VALUES(11, 911, 'CT', '_LS-ULT-LNX', 'IPTDS_TEST_REQUEST', 1387);

-- END  IPTDS DATA --

-- START MODEL TYPE --
INSERT INTO AUTOSC.CFG_IIP_VERSION_CONN_INFO (
   MODEL_TYPE, IIP_VERSION, CONN_TYPE) 
VALUES ( 'GSTTEST', 4.0, 'ONWATCH' );
-- END MODEL TYPE --
	
Commit;